//申明一个数组，使用do-while对数组元素进行翻转

function reverse() {
    //数组起始下标
    let start = 0;
    let end = arr.length - 1;
    do {
        let t = arr[start];
        arr[start] = arr[end];
        arr[end] = t;
        start++;
        end--;
    } while (start <= end)
    return arr;
}
console.log(reverse([1, 2, 3, 4, 5, 6]));
